package ltd.dujiabao.capability.adapter.driving.restful;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import ltd.dujiabao.capability.application.rulemng.SupportDTO;
import ltd.dujiabao.capability.application.rulemng.SupportResultDTO;
import ltd.dujiabao.capability.application.rulemng.SupportService;
import ltd.dujiabao.capability.common.dto.ErrorCodes;
import ltd.dujiabao.capability.common.dto.Result;

/**
 * @author : DuJiabao
 * @Project : ddd-capability
 * @Time : 2024/4/13 12:02
 * @Desc :
 */
@RestController
public class SupportController {

    @Autowired
    private SupportService supportService;

    @PostMapping("checkIfSupport")
    public Result<SupportResultDTO> checkIfSupport(@RequestBody SupportDTO dto) {
        SupportResultDTO result = supportService.checkIfSupport(dto);
        return new Result<>(ErrorCodes.SUCCESS.getCode(), result);
    }
}
